package com.portal.redis.lock;


/**
 * 分布式锁
 *
 * @author Amadeus
 * @date 2022/07/07
 */
public interface DistributedLock {
    /**
     * 获取锁
     *
     * @param key
     * @return
     */
    Boolean lock(String key);

    /**
     * 获取锁
     *
     * @param key
     * @param expireTime
     * @return
     */
    Boolean lock(String key, Long expireTime);

    /**
     * 释放锁
     *
     * @param key
     */
    void unLock(String key);
}
